<%-- 
    Document   : client-list
    Created on : 2014-12-02, 23:35:20
    Author     : michal
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>

<jsp:include page="/header.jsp" />

<html:form action="client.do">
<table>
    <tr>
        <th>#</th>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>PESEL</th>
        <th>Address</th>
        <th colspan="2">Options</th>
    </tr>
    <% int i=1; %>
    <logic:iterate name="clients" id="ClientActionForm">
        <tr data-client-id="<bean:write name="ClientActionForm" property="clientId" />">
            <td class="text-center"><%= i++ %></td>
            <td><bean:write name="ClientActionForm" property="firstname" /></td>
            <td><bean:write name="ClientActionForm" property="lastname" /></td>
            <td><bean:write name="ClientActionForm" property="pesel" /></td>
            <td><bean:write name="ClientActionForm" property="address" /></td>
            <td class="text-center"><a href="client.do?method=manage&amp;clientId=<bean:write name="ClientActionForm" property="clientId" />" title="Update" class="update-client">
                <img src="<%=request.getContextPath()%>/img/pencil.png" alt="Update" />
            </a></td>
            <td class="text-center"><a href="client.do?method=delete&amp;clientId=<bean:write name="ClientActionForm" property="clientId" />" title="Delete" class="delete-client">
                <img src="<%=request.getContextPath()%>/img/cross.png" alt="Delete" />
            </a></td>
        </tr>
        
    </logic:iterate>
</table>
</html:form>

<jsp:include page="/footer.jsp" />